import paramiko

def sshLink(ipaddress,port,user,password,size,timeout):
    ssh = paramiko.Transport(ipaddress + ':' + str(port),size)
    ssh.start_client()
    ssh.auth_password(user,password)
    # 每六十秒发送激活包
    ssh.set_keepalive(60)
    sshChannel = ssh.open_session()
    sshChannel.settimeout(timeout)
    sshChannel.get_pty()
    sshChannel.invoke_shell()
    return sshChannel